home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_01
/
1001098b
< prev
next >
Wrap
Text File
|
1991-11-16
|
292b
|
20 lines
Listing 9
//
// operator-
//
rational rational::operator-(rational r)
{
return rational(num * r.denom - r.num * denom,
denom * r.denom);
}
//
// operator-= written in terms of operator-
//
rational &rational::operator-=(rational r)
{
return *this = *this - r;
}